package dao.wechatlab.impl;

import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Transaction;
import org.springframework.stereotype.Repository;

import dao.BaseDao;
import dao.wechatlab.AdministratorDao;
import pojo.jane.StudentBean;

@Repository
@SuppressWarnings("unchecked")
public class AdministratorDaoImpl extends BaseDao implements AdministratorDao{

	@Override
	public List<StudentBean> selectAllPrimaryUser() {
		
		 List<StudentBean> list ;
		  try {
		   Transaction tx = currentSession().beginTransaction();
		   Query query = currentSession().createQuery("select new StudentBean(userid,name,email,phone,identity,time,authgroup, lower,upper) from StudentBean where authgroup!=0 and authgroup!=1");
		   list = query.list();
		   tx.commit();
		   return list;
		  }catch (HibernateException e) {
			   // TODO Auto-generated catch block
			   e.printStackTrace();
			   throw e;
		  }
	}

}
